Contents | Index | < Browse | Browse >

LETTERfreadULETTER Reads data blocks from a file.

Overview
#include <stdio.h>

r = fread(ptr,size,n,f);

unsigned int r;
void *ptr;
unsigned int size;
unsigned int n;
FILE *f;

Portability
ANSI

Description
"fread" reads "n" blocks of the size "size" from the file referred to by "f" into the memory location pointed to by "ptr".

Returns
"fread" returns the number of blocks read, which may be smaller than "n" (eg. if the end of the file has been reached).